<?php if (!defined('THINK_PATH')) exit();?><html>
<title>留言板</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<link rel="stylesheet" type="text/css" href="/Public/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/Public/css/bootstrap-theme.min.css">
<script type="text/javascript" src="/Public/js/jquery.min.js"></script>
<script type="text/javascript" src="/Public/js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(function(){
	});
	function previous(){
		var val = $("#pageIndex");
		if ($("#pageIndex").html() == 1) {
			return;
		};
		window.location.href="/index.php/home/message/index?pageIndex="+(val.html()-1);
	}
	function next(){
		var val = $("#pageIndex");
		if ($("#pageIndex").html() == <?php echo ($count); ?>) {
			return;
		};
		window.location.href="/index.php/home/message/index?pageIndex="+(val.html()-(-1));
	}
</script>
<body>
<nav class="navbar-inverse navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/index.php/Home/Message/index">留言板</a>
    </div>

    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="/index.php/Home/Message/index">首页</a></li>
      </ul>

      <ul class="nav navbar-nav navbar-right">
        <li><a href="/">登陆</a></li>
        <li><a href="/index.php/Home/User/register">注册</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo ($_SESSION['account']); ?><span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="/index.php/Home/User/logout">登出</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>
<style type="text/css">
	.c{
		height: 100px
	}
</style>

<div class="container">
	<div class="row">
		<div class="col-md-8">
		<h2 class="text-center">留言板</h2>
		<?php if(is_array($messages)): $i = 0; $__LIST__ = $messages;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$message): $mod = ($i % 2 );++$i;?><ul class="list-group">
			  <li class="list-group-item list-group-item-success active">
			  	<div class="col-md-9">网友：<?php echo ($message["user"]["account"]); ?></div><div class="s"><?php echo ($message["time"]); ?></div>
			  </li>
			  <li class="list-group-item list-group-item-success c">
			  	<p><?php echo ($message["content"]); ?>
			  </li>
			</ul><?php endforeach; endif; else: echo "" ;endif; ?>
			<nav class="col-md-offset-9">
			  <ul class="pagination">
			    <li id="pre">
			      <a href="#" onclick="previous()"aria-label="Previous">
			        <span aria-hidden="true">&laquo;</span>
			      </a>
			    </li>
			    <li class="active"><a id="pageIndex" href="#"><?php echo ($pageIndex); ?></a></li>
			    <li id="nex">
			      <a href="#" onclick="next()"aria-label="Next">
			        <span aria-hidden="true">&raquo;</span>
			      </a>
			    </li>
			  </ul>
			</nav>

			<form action="/index.php/Home/Message/create" method="post">
				<textarea rows="5" cols="100%" name="content">
				在w3school，你可以找到你所需要的所有的网站建设教程。
				</textarea>
				<input type="submit" value="留言">
			</form>
		</div>

		<div class="col-md-4" >
			<br/><br/><br/><br/><br/>
			<div class="input-group">
      			<input type="text" class="form-control" placeholder="Search for...">
      			<span class="input-group-btn">
        		<button class="btn btn-default" type="button">Go!</button>
      			</span>
    		</div><!-- /input-group -->
    		<div class="hero-unit">
				<h1>
					布局凑数
				</h1>
				<p>
					这是一个可视化布局模板, 你可以点击模板里的文字进行修改, 也可以通过点击弹出的编辑框进行富文本修改. 拖动区块能实现排序.
				</p>
				<p>
					<a class="btn btn-primary btn-large" href="www.baidu.com">参看更多 »</a>
				</p>
			</div>
		</div>
	</div>
</div>

</body>
</html>